﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp16
{
    class Program
    {
        static void Main(string[] args)
        {
            Stack stack = new Stack();
            stack.Push("一号箱子");
            stack.Push("二号箱子");
            stack.Push("三号箱子");
            stack.Push("四号箱子");
            stack.Push("五号箱子");
            object[] vs = stack.ToArray();
            foreach (var a in vs)
            {
                Console.WriteLine(a);
            }
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine("最后一个放入的箱子是");
            Console.WriteLine(stack.Peek());
            
        }
    }
}
